package com.coderdream.classdemo;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			A a1 = new C();
//			Class.forName("C").newInstance();Class
			A a2 = (A) Class.forName("com.coderdream.classdemo.C").newInstance();
			
			//B b = (B) Class.forName("D").newInstance();
			B b1 = new D();
			B b2 = (B) Class.forName("com.coderdream.classdemo.D").newInstance();
			
			A a3 = new E();
			B b3 = new E();
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
